package com.swpu.service_knowledge.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.swpu.service_knowledge.entity.KnowledgeCategory;
import com.swpu.service_knowledge.mapper.KnowledgeCategoryMapper;
import com.swpu.service_knowledge.service.KnowledgeCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chaichai
 * @since 2024-03-27
 */
@Service
public class KnowledgeCategoryServiceImpl extends ServiceImpl<KnowledgeCategoryMapper, KnowledgeCategory> implements KnowledgeCategoryService {

    @Override
    public List<KnowledgeCategory> getCategoryList() {
        LambdaQueryWrapper<KnowledgeCategory> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(KnowledgeCategory::getStatus,1);
        queryWrapper.orderByDesc(KnowledgeCategory::getCreateTime);
      return   this.list(queryWrapper);
    }
}
